package Bloom;

import java.util.Random;

public class text {
    public static void main(String[] args) {
        BloomFilter hh = new BloomFilter();
        Random random = new Random();
        //测试误判
        System.out.println("1000000".hashCode());
        System.out.println("1000001".hashCode());
        System.out.println("2000000".hashCode());
        System.out.println("2000001".hashCode());


        for (int i = 1; i < 1000000; i++) {
            hh.push(random.nextInt(i));
        }
        int count = 0;
        for (int i = 1000000; i < 3000000; i++) {
            if(!hh.contain(i)){
                count++;
            }
        }
        System.out.println(count);
    }
    public static void main1(String[] args) {
        BloomFilter hh = new BloomFilter();
        hh.push("hhh");
        hh.push(1000);
        System.out.println(hh.contain(1000));
        System.out.println(hh.contain("hhh1"));

    }
}
